const sd = require('silly-datetime');


function DateTime() {
}

/**
 *
 * @param date Date
 * @param format 'YYYY-MM-DD HH:mm:ss'
 */
DateTime.format = function (date, format) {
    return sd.format(date, format)
}

/**
 *
 * @param format 'YYYY-MM-DD HH:mm:ss'
 */
DateTime.formatNow = function (format) {
    return this.format(new Date(), format)
}

/**
 *
 * @param dateTime Date.getTime
 * @param format 'YYYY-MM-DD HH:mm:ss'
 */
DateTime.formatDateTime = function (dateTime, format) {
    return this.format(new Date(dateTime), format)
}

module.exports = DateTime;